#ifndef _HCC_ERROR_CODE_MOD_BOOTLOADER_H_
#define _HCC_ERROR_CODE_MOD_BOOTLOADER_H_

#include "ofc/ofc_types.h"
#include "hcc/hcc_error_code.h"
#include "hcc/hcc_error_code_app.h"

#ifdef __cplusplus
extern "C" {
#endif

// 不含行号的错误码生成
#define HCC_MAKE_MOD_BOOTLOADER_ERROR(error_code) (int)HCC_MAKE_APP_ERROR(kHccBootloader, error_code, HCC_ERROR_LEVEL_ERROR)
// 含行号的错误码生成
#define HCC_MAKE_MOD_BOOTLOADER_ERROR_LINE(error_code) (int)HCC_ERROR(HCC_MAKE_APP_ERROR(kHccBootloader, error_code, HCC_ERROR_LEVEL_ERROR))


/**
 * BOOT_LOADER:
 */
enum THccAppBootloaderErrorCodeTag
{
	QB_ERR_OK	=	HCC_ERROR_SUCCESS,			///< 成功,没有错误
	QB_ERR_FAILED	=	HCC_MAKE_MOD_BOOTLOADER_ERROR(1),			///<失败
	QB_ERR_PREPARE_FAILED	=	HCC_MAKE_MOD_BOOTLOADER_ERROR(2),			///<准备失败
	QB_ERR_COND_WAIT	=	HCC_MAKE_MOD_BOOTLOADER_ERROR(3),			///<等待条件未满足
	QB_ERR_EXCEPTION_OCCURRED	=	HCC_MAKE_MOD_BOOTLOADER_ERROR(4),			///<意料之外的错误
	QB_ERR_UNEXPECTED_STATE	=	HCC_MAKE_MOD_BOOTLOADER_ERROR(5),			///<异常状态
	QB_ERR_PARTITION_NOTFOUND	=	HCC_MAKE_MOD_BOOTLOADER_ERROR(6),			///<指定分区未找到
	QB_ERR_PARTITION_OPEN	=	HCC_MAKE_MOD_BOOTLOADER_ERROR(7),			///<分区打开失败
	QB_ERR_BKUPPART_NOCONFIG	=	HCC_MAKE_MOD_BOOTLOADER_ERROR(8),			///<备份分区未配置
	QB_ERR_INVALID_PARAM	=	HCC_MAKE_MOD_BOOTLOADER_ERROR(9),			///<参数无效
	QB_ERR_BKUPSPACE_NotEnough	=	HCC_MAKE_MOD_BOOTLOADER_ERROR(10),			///<备份空间不足
	QB_ERR_IO	=	HCC_MAKE_MOD_BOOTLOADER_ERROR(11),			///<IO错误
	QB_ERR_OUT_OF_SPACE	=	HCC_MAKE_MOD_BOOTLOADER_ERROR(12),			///<空间不足
	QB_ERR_SECTADDR_NOTALIGN	=	HCC_MAKE_MOD_BOOTLOADER_ERROR(13),			///<扇区地址未对齐
	QB_ERR_INVALID_STATE	=	HCC_MAKE_MOD_BOOTLOADER_ERROR(14),			///<无效状态
	QB_ERR_CHKSUM	=	HCC_MAKE_MOD_BOOTLOADER_ERROR(15),			///<校验和错误
	QB_ERR_BLOCKDEV_NOTFOUND	=	HCC_MAKE_MOD_BOOTLOADER_ERROR(16),			///<块设备未找到
	QB_ERR_WRONG_IMAGE_TAG	=	HCC_MAKE_MOD_BOOTLOADER_ERROR(17),			///<IMAGE_TAG错误
	QB_ERR_WRONG_IMAGE_SIZE	=	HCC_MAKE_MOD_BOOTLOADER_ERROR(18),			///<IMAGE_SIZE错误
	QB_ERR_INVALID_DEVNAME	=	HCC_MAKE_MOD_BOOTLOADER_ERROR(19),			///<无效的错误名称
	QB_ERR_COMPARE	=	HCC_MAKE_MOD_BOOTLOADER_ERROR(20),			///<比较错误
	QB_ERR_NOTSUPPORT	=	HCC_MAKE_MOD_BOOTLOADER_ERROR(21),			///<不支持的操作
	QB_ERR_TIMEOUT	=	HCC_MAKE_MOD_BOOTLOADER_ERROR(22),			///<操作超时
	QB_ERR_NOTSUPPORT_BPC_SRV	=	HCC_MAKE_MOD_BOOTLOADER_ERROR(23),			///<BPC服务不支持
	QB_ERR_NOTSUPPORT_BPC_METHOD	=	HCC_MAKE_MOD_BOOTLOADER_ERROR(24),			///<BPC方法不支持
	QB_ERR_OUT_OF_DATERANGE	=	HCC_MAKE_MOD_BOOTLOADER_ERROR(25),			///<超出日期范围
	QB_ERR_VER_DONTWORK	=	HCC_MAKE_MOD_BOOTLOADER_ERROR(26),			///<版本不兼容
	QB_ERR_PARTITION_PROTECTED	=	HCC_MAKE_MOD_BOOTLOADER_ERROR(27),			///<分区受保护
	QB_ERR_OUT_OF_PARTRANGE	=	HCC_MAKE_MOD_BOOTLOADER_ERROR(28),			///<超出分区范围
	QB_ERR_SHAKEHANDS_TIMEOUT	=	HCC_MAKE_MOD_BOOTLOADER_ERROR(29),			///<握手超时
};
typedef enum THccAppBootloaderErrorCodeTag THccAppBootloaderErrorCode;


typedef Int32 THccAppBootloaderErrorCodeLine;
#define QB_ERR_SuccessLine	HCC_ERROR_SUCCESS	///< 成功,没有错误
#define QB_ERR_FAILEDLine	HCC_MAKE_MOD_BOOTLOADER_ERROR_LINE(1)	///<失败
#define QB_ERR_PREPARE_FAILEDLine	HCC_MAKE_MOD_BOOTLOADER_ERROR_LINE(2)	///<准备失败
#define QB_ERR_COND_WAITLine	HCC_MAKE_MOD_BOOTLOADER_ERROR_LINE(3)	///<等待条件未满足
#define QB_ERR_EXCEPTION_OCCURREDLine	HCC_MAKE_MOD_BOOTLOADER_ERROR_LINE(4)	///<意料之外的错误
#define QB_ERR_UNEXPECTED_STATELine	HCC_MAKE_MOD_BOOTLOADER_ERROR_LINE(5)	///<异常状态
#define QB_ERR_PARTITION_NOTFOUNDLine	HCC_MAKE_MOD_BOOTLOADER_ERROR_LINE(6)	///<指定分区未找到
#define QB_ERR_PARTITION_OPENLine	HCC_MAKE_MOD_BOOTLOADER_ERROR_LINE(7)	///<分区打开失败
#define QB_ERR_BKUPPART_NOCONFIGLine	HCC_MAKE_MOD_BOOTLOADER_ERROR_LINE(8)	///<备份分区未配置
#define QB_ERR_INVALID_PARAMLine	HCC_MAKE_MOD_BOOTLOADER_ERROR_LINE(9)	///<参数无效
#define QB_ERR_BKUPSPACE_NotEnoughLine	HCC_MAKE_MOD_BOOTLOADER_ERROR_LINE(10)	///<备份空间不足
#define QB_ERR_IOLine	HCC_MAKE_MOD_BOOTLOADER_ERROR_LINE(11)	///<IO错误
#define QB_ERR_OUT_OF_SPACELine	HCC_MAKE_MOD_BOOTLOADER_ERROR_LINE(12)	///<空间不足
#define QB_ERR_SECTADDR_NOTALIGNLine	HCC_MAKE_MOD_BOOTLOADER_ERROR_LINE(13)	///<扇区地址未对齐
#define QB_ERR_INVALID_STATELine	HCC_MAKE_MOD_BOOTLOADER_ERROR_LINE(14)	///<无效状态
#define QB_ERR_CHKSUMLine	HCC_MAKE_MOD_BOOTLOADER_ERROR_LINE(15)	///<校验和错误
#define QB_ERR_BLOCKDEV_NOTFOUNDLine	HCC_MAKE_MOD_BOOTLOADER_ERROR_LINE(16)	///<块设备未找到
#define QB_ERR_WRONG_IMAGE_TAGLine	HCC_MAKE_MOD_BOOTLOADER_ERROR_LINE(17)	///<IMAGE_TAG错误
#define QB_ERR_WRONG_IMAGE_SIZELine	HCC_MAKE_MOD_BOOTLOADER_ERROR_LINE(18)	///<IMAGE_SIZE错误
#define QB_ERR_INVALID_DEVNAMELine	HCC_MAKE_MOD_BOOTLOADER_ERROR_LINE(19)	///<无效的错误名称
#define QB_ERR_COMPARELine	HCC_MAKE_MOD_BOOTLOADER_ERROR_LINE(20)	///<比较错误
#define QB_ERR_NOTSUPPORTLine	HCC_MAKE_MOD_BOOTLOADER_ERROR_LINE(21)	///<不支持的操作
#define QB_ERR_TIMEOUTLine	HCC_MAKE_MOD_BOOTLOADER_ERROR_LINE(22)	///<操作超时
#define QB_ERR_NOTSUPPORT_BPC_SRVLine	HCC_MAKE_MOD_BOOTLOADER_ERROR_LINE(23)	///<BPC服务不支持
#define QB_ERR_NOTSUPPORT_BPC_METHODLine	HCC_MAKE_MOD_BOOTLOADER_ERROR_LINE(24)	///<BPC方法不支持
#define QB_ERR_OUT_OF_DATERANGELine	HCC_MAKE_MOD_BOOTLOADER_ERROR_LINE(25)	///<超出日期范围
#define QB_ERR_VER_DONTWORKLine	HCC_MAKE_MOD_BOOTLOADER_ERROR_LINE(26)	///<版本不兼容
#define QB_ERR_PARTITION_PROTECTEDLine	HCC_MAKE_MOD_BOOTLOADER_ERROR_LINE(27)	///<分区受保护
#define QB_ERR_OUT_OF_PARTRANGELine	HCC_MAKE_MOD_BOOTLOADER_ERROR_LINE(28)	///<超出分区范围
#define QB_ERR_SHAKEHANDS_TIMEOUTLine	HCC_MAKE_MOD_BOOTLOADER_ERROR_LINE(29)	///<握手超时

#ifdef __cplusplus
}  // extern "C"
#endif

#endif // _HCC_ERROR_CODE_MOD_BOOTLOADER_H_
/**
 * @
 */
